from sqlalchemy.orm import Session

from crud import ClassAdminCrud
from schema.QuerySchema import QueryBase, ClassQuery, ClassByStatusListQuery, ClassByStatusAndPageQuery
from schema.TeachingSchema import ClassInfo


class ClassAdminController:
    @staticmethod
    def add_class(classInfo: ClassInfo, db: Session):
        return ClassAdminCrud.add_class(classInfo, db)

    @staticmethod
    def mod_class(classInfo: ClassInfo, db: Session):
        return ClassAdminCrud.mod_class(classInfo, db)

    @staticmethod
    def query_class_by_field(classQuery: ClassQuery, db: Session):
        return ClassAdminCrud.query_class_by_field(classQuery, db)

    @staticmethod
    def query_class_all_students(db: Session):
        return ClassAdminCrud.query_class_all_students(db)

    @staticmethod
    def query_class_by_page(query_base: QueryBase, db: Session):
        return ClassAdminCrud.query_class_by_page(query_base, db)

    @staticmethod
    def query_class_all_by_status(classByStatusListQuery: ClassByStatusListQuery, db: Session):
        return ClassAdminCrud.query_class_all_by_status(classByStatusListQuery, db)

    @staticmethod
    def query_class_all_by_status_and_page(classByStatusAndPageQuery: ClassByStatusAndPageQuery, db: Session):
        return ClassAdminCrud.query_class_all_by_status_and_page(classByStatusAndPageQuery, db)
